package jsu.xxy.coffee3.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import jsu.xxy.coffee3.domain.Supplier;
import jsu.xxy.coffee3.domain.SupplierAndMaterials;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
* @author 张从轩
* @description 针对表【supplier】的数据库操作Mapper
* @createDate 2023-06-03 06:43:14
* @Entity jsu.xxy.coffee3.domain.Supplier
*/
@Mapper
public interface SupplierMapper extends BaseMapper<Supplier> {
    public List<SupplierAndMaterials> selectOnePage(int i, Integer pageSize);

    public List<SupplierAndMaterials> selectByName(String name ,Integer i, Integer pageSize);

    public int deleteByIds(Integer mid, Integer supplierid);

    @Insert("insert into supplier (name , address , phone) values (#{name} , #{address} , #{phone})")
    public int addSupplier(String name, String address, String phone);

    public List<Integer> getSupplierId(String name);

    public List<SupplierAndMaterials> selectByNameSupplier(String name, int i, Integer pageSize);
    @Update("update supplier set name=#{name},address=#{address},phone=#{phone} where supplierid=#{supplier}")
    void updateByAll(Supplier supplier);

    public Integer selectAllcount();

    public long getCount(String name);

    List<SupplierAndMaterials> selectAll();

    List<Supplier> selectByNamePhoneAddress(String name, String phone, String address);
}
